package ch.fhnw.ams.sudoku.io;

import java.util.Date;

import ch.fhnw.ams.sudoku.SudokuGrid;

/**
 * This interface isolates the application from the persistence layer.
 * 
 * @author amsler
 * 
 */
public interface SudokuDAO {

	/**
	 * Loads the data.
	 * 
	 * @param id
	 *            unique id, path or name of the game.
	 * @throws SudokuDAOException
	 *             Signals that an exception from the persistence layer has
	 *             occurred.
	 */
	public void load(String id) throws SudokuDAOException;

	/**
	 * Saves the data.
	 * 
	 * @param id
	 *            unique id, path or name of the game.
	 * @throws SudokuDAOException
	 *             Signals that an exception from the persistence layer has
	 *             occurred.
	 */
	public void save(String id) throws SudokuDAOException;
	
	/**
	 * Gets the sudoku grid.
	 *
	 * @return the sudoku grid
	 */
	public SudokuGrid getSudokuGrid();

	/**
	 * Sets the sudoku grid.
	 *
	 * @param sudokuGrid the sudoku grid
	 */
	public void setSudokuGrid(SudokuGrid sudokuGrid);

	/**
	 * Gets the name of the player
	 *
	 * @return the name of the player
	 */
	public String getPlayerName();

	/**
	 * Sets the name of the player
	 *
	 * @param playerName the name of the player
	 */
	public void setPlayerName(String playerName);

	/**
	 * Gets the date when the game was created.
	 *
	 * @return the creation date
	 */
	public Date getCreationDate();

	/**
	 * Sets the date when the game was created.
	 *
	 * @param creationDate the new creation date
	 */
	public void setCreationDate(Date creationDate);

	
	public long getTimePlayed();

	
	public void setTimePlayed(long timePlayed);
}
